<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>RTOS - a cooperative multitasking library: RTOS::waitable Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">RTOS - a cooperative multitasking library
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="class_r_t_o_s.html">RTOS</a>      </li>
      <li class="navelem"><a class="el" href="class_r_t_o_s_1_1waitable.html">waitable</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">RTOS::waitable Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="RTOS::waitable" --><!-- doxytag: inherits="RTOS::event" -->
<p>abstract thing that a task can wait for  
 <a href="class_r_t_o_s_1_1waitable.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="p_r_t_o_s_8h_source.html">pRTOS.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for RTOS::waitable:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_r_t_o_s_1_1waitable.png" usemap="#RTOS::waitable_map" alt=""/>
  <map id="RTOS::waitable_map" name="RTOS::waitable_map">
<area href="class_r_t_o_s_1_1event.html" title="set of things that can happen, or a thing that has happened" alt="RTOS::event" shape="rect" coords="261,0,425,24"/>
<area href="class_r_t_o_s_1_1channel__base.html" title="RTOS private implementation class." alt="RTOS::channel_base" shape="rect" coords="0,112,164,136"/>
<area href="class_r_t_o_s_1_1clock.html" title="free-running clock, ticks at a fixed frequency" alt="RTOS::clock" shape="rect" coords="174,112,338,136"/>
<area href="class_r_t_o_s_1_1flag.html" title="basic synchronisation mechanism." alt="RTOS::flag" shape="rect" coords="348,112,512,136"/>
<area href="class_r_t_o_s_1_1timer.html" title="one-short timer" alt="RTOS::timer" shape="rect" coords="522,112,686,136"/>
<area href="class_r_t_o_s_1_1channel.html" title="waitable data queue" alt="RTOS::channel&lt; T, SIZE &gt;" shape="rect" coords="0,168,164,192"/>
</map>
 </div></div>

<p><a href="class_r_t_o_s_1_1waitable-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_t_o_s_1_1waitable.html#a44ac71980592721bc03e076acc7e8c67">clear</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">clear the waitable  <a href="#a44ac71980592721bc03e076acc7e8c67"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_t_o_s_1_1waitable.html#a5a5bf9012a332a6451ee10728153908a">waitable</a> (<a class="el" href="class_r_t_o_s_1_1task.html">task</a> *<a class="el" href="class_r_t_o_s_1_1task.html">task</a>, const char *name)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">constructor, specify owner and name  <a href="#a5a5bf9012a332a6451ee10728153908a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a72bdf94092471e82ba2d04cdc4a58e"></a><!-- doxytag: member="RTOS::waitable::set" ref="a3a72bdf94092471e82ba2d04cdc4a58e" args="(void)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_t_o_s_1_1waitable.html#a3a72bdf94092471e82ba2d04cdc4a58e">set</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set the waitable <br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0ee29d8961a0b67cea2c3fa76da116da"></a><!-- doxytag: member="RTOS::waitable::waitable_set" ref="a0ee29d8961a0b67cea2c3fa76da116da" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>waitable_set</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>abstract thing that a task can wait for </p>
<p>The operation <a class="el" href="class_r_t_o_s_1_1waitable.html#a44ac71980592721bc03e076acc7e8c67" title="clear the waitable">clear()</a> is provided (virtual, the default only clears the waitable) <a class="el" href="class_r_t_o_s_1_1waitable.html#a3a72bdf94092471e82ba2d04cdc4a58e" title="set the waitable">set()</a> is provided but private (not all waitables can be set by the user).</p>
<p>Waitable is an abstract class (there are no objects that are just a waitable). <a class="el" href="class_r_t_o_s_1_1flag.html">flag</a>, <a class="el" href="class_r_t_o_s_1_1timer.html">timer</a>, <a class="el" href="class_r_t_o_s_1_1clock.html">clock</a> and <a class="el" href="class_r_t_o_s_1_1channel.html">channel</a> are concrete classes that inherit from waitable. A waitable is always created for a particular task. A maximum of 31 waitables can be created for each task. (Actually the maximum is 32, but one waitable created internally to implement the sleep() call.) A waitable can be two states: set or cleared. A waitable is initially cleared.</p>
<p>A task can wait for one, a subset, or all waitables created for it. The default is to wait for all waitables created for the task, the other variants are specified by supplying to the task:wait() call either a single waitable, or the sum (operator+) of the waitables you want to wait for. When one of the waitables that is waited for is or becomes set the wait() call clears that waitable and returns an event that compares equal to the waitable. (Note that some waitables, for instance the channel, can immediately set itself again.) The calling task can compare that event to the waitables to see which event happened. When more than one of the waited-for waitables is set the wait() call makes an arbitrary choice from these waitables. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5a5bf9012a332a6451ee10728153908a"></a><!-- doxytag: member="RTOS::waitable::waitable" ref="a5a5bf9012a332a6451ee10728153908a" args="(task *task, const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RTOS::waitable::waitable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_r_t_o_s_1_1task.html">task</a> *&#160;</td>
          <td class="paramname"><em>task</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>constructor, specify owner and name </p>
<p>The name is used for debugging only. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a44ac71980592721bc03e076acc7e8c67"></a><!-- doxytag: member="RTOS::waitable::clear" ref="a44ac71980592721bc03e076acc7e8c67" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void RTOS::waitable::clear </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>clear the waitable </p>
<p>This is automatically doen when the waitable causes a <a class="el" href="class_r_t_o_s_1_1task.html#a6fc603d0f1c8a94813586d3dfd123fcc" title="wait for all waitables created for this task">task::wait()</a> call to return it. </p>

<p>Reimplemented in <a class="el" href="class_r_t_o_s_1_1channel.html#afd8cd81a91225ed144fc1ca20f3cd8f6">RTOS::channel&lt; T, SIZE &gt;</a>, and <a class="el" href="class_r_t_o_s_1_1clock.html#a90d7c2b274fff1b43a1de08e742c41c3">RTOS::clock</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="p_r_t_o_s_8h_source.html">pRTOS.h</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Apr 14 2012 15:59:34 for RTOS - a cooperative multitasking library by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
